﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Caca.MineSweeper.AI
{
    struct Location
    {
        public int X;
        public int Y;

        public static int[,] SurroundsOffset = 
        {
            {-1, -1},
            {-1, 0},
            {-1, 1},
            {0, -1},
            {0, 1},
            {1, -1},
            {1, 0},
            {1, 1}
        };

        internal IEnumerable<Location> GetSurrounds()
        {
            List<Location> result = new List<Location>();
            for (int i = 0; i < SurroundsOffset.GetLength(0); i++)
            {
                result.Add(new Location()
                {
                    X = this.X + SurroundsOffset[i, 0],
                    Y = this.Y + SurroundsOffset[i, 1]
                });
            }
            
            return result;
        }
    }

}
